import fetch from '../../common/fetch';
import {observable, action, runInAction, useStrict} from 'mobx';
useStrict(true);

const security = '/security', version = '/api/v1';
const api = {
  // menuList: (id) => `${security}${version}/users/${id}/menuResources`,
  menuList: '/api/menu/list',
}

export default class MenuStore{
  @observable list = [];

  @action getList = async () => {
    let data = await fetch.post(api.menuList);
    runInAction(() => {
      this.list = data;
    });
  }
}